DEFINT A-Z
' Координаты
DATA 0, 0, 40, -15, 40, 15, 80, 0
DATA 0, 40, 40, 55, 80, 40
' Полигоны
DATA 0, 1, 3, 2, 3
DATA 0, 2, 5, 4, 1
DATA 2, 3, 6, 5, 2
DIM Mas%(500), Lns(2, 3), Cv(2)
' Загрузка объекта
FOR i = 0 TO 6
READ X(i), Y(i)
NEXT
FOR i = 0 TO 2
READ Lns(i, 0), Lns(i, 1), Lns(i, 2), Lns(i, 3), Cv(i)
NEXT
' Инициализация
SCREEN 13
OUT &H3C8, 1: OUT &H3C9, 24: OUT &H3C9, 24: OUT &H3C9, 24
OUT &H3C8, 2: OUT &H3C9, 32: OUT &H3C9, 32: OUT &H3C9, 32
OUT &H3C8, 3: OUT &H3C9, 40: OUT &H3C9, 40: OUT &H3C9, 40
' Цикл работы программы
NowTm! = TIMER
DO: Kb$ = INKEY$
IF TIMER > NowTm! + 5 THEN Vnesti = 1: NowTm! = TIMER
LINE (0, 0)-(0, 80), 15
FOR Gx = 318 TO 0 STEP -1
GET (Gx, Gx / 2.7)-(Gx, Gx / 2.7 + 80), Mas%
PUT (Gx + 1, (Gx + 1) / 2.7), Mas%, PSET
NEXT Gx
IF Vnesti = 1 THEN
FOR Pn = 0 TO 2
' Отрисовка объекта
CntX = 0: CntY = 0
FOR i = 0 TO 3
x1 = X(Lns(Pn, i)) + 1
y1 = Y(Lns(Pn, i)) + 30
x2 = X(Lns(Pn, (i + 1) AND 3)) + 1
y2 = Y(Lns(Pn, (i + 1) AND 3)) + 30
LINE (x1, y1)-(x2, y2), Cv(Pn)
CntX = CntX + x1: CntY = CntY + y1
NEXT
PAINT (CntX \ 4, CntY \ 4), Cv(Pn), Cv(Pn)
NEXT Pn
Vnesti = 0
END IF
LOOP UNTIL Kb$ = CHR$(27)
Тестирование выполнено в программе QB64 ( Скачать )